/*
 * Copyright 2008 Slava Chernyak
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 */
package com.chernyak.DataAdapter;

/**
 * Represents an exception encountered by the Data Adapter compiler when 
 * tokenizing, parsing, or typechecking the Data Adapter specification 
 * 
 * @author Slava Chernyak
 */
public class CompilerException extends RuntimeException {
  private static final long serialVersionUID = 5273136805074934838L;
  private int ln;
	
  /**
   * Get the line number in the Data Adapter specificatoin associated 
   * with this exception.
   * @return The line number
   */
	public int getLineNumber() {
		return ln;
	}
	
	/**
	 * Create a new compiler exception associated with the specified 
	 * line number
	 * @param ln The line number
	 */
	public CompilerException(int ln) { 
		super();
		this.ln = ln;
	}
	
	/**
	 * Create a new compiler exception associated with the specified 
	 * line number and having the given error message
	 * @param message The message
	 * @param ln The line number
	 */
	public CompilerException(String message, int ln) { 
		super(message); 
		this.ln = ln;
	}
}
